/**
 * @Author YuanYuan
 * @Date 2022/5/19
 * @Time 18:31
 */
public class TestDemo {
    public static void main(String[] args) throws CloneNotSupportedException {
        Person person1 = new Person("yuanyuan",18);
        Person person2 = (Person) person1.clone();
        System.out.println(person1.toString());
        System.out.println(person2.toString());
        System.out.println("--------------------------");
        person2.getMoney().setMoney(99.9);
        System.out.println(person1.toString());
        System.out.println(person2.toString());
    }
    public static void main1(String[] args) throws CloneNotSupportedException {
        Person person1 = new Person("yuanyuan",18);
        Person person2 = (Person) person1.clone();

        System.out.println(person1.toString());
        System.out.println(person2.toString());
        System.out.println("--------------------------");
        person2.setName("xianxian");
        System.out.println(person1.toString());
        System.out.println(person2.toString());
        System.out.println("-------------------------");
    }
}
